import instanceStat from "../requestStat";

// 【】首页图表
interface ISaleMapItem {
  areaName: string;
  hasTrade: number;
  saleNum: number;
  __typename: string;
}
interface ISalePieItem {
  first_cid: number;
  fourteen_days_money: string;
  name: string;
  sale_fourteen_days: string;
  sale_seven_days: string;
  sale_sixty_days: string;
  sale_thirty_days: string;
  sale_three_days: string;
  sale_today: string;
  sale_yesterday: string;
  seven_days_money: string;
  sixty_days_money: string;
  thirty_days_money: string;
  three_days_money: string;
  today_money: string;
  yesterday_money: string;
  [key: string]: string | number;
}

interface IAdminStatRes {
  saleMap: ISaleMapItem[];
  salePie: ISalePieItem[];
}

const getAdminStat = (): Promise<IAdminStatRes> => {
  return instanceStat.get("/admin/stat");
}

export { getAdminStat }
export type { ISalePieItem }
